package com.code.mvc.dao;

import com.code.mvc.bean.User;
import org.apache.ibatis.annotations.*;

/**
 * 源码分析测试类
 * 1.纯注解集成
 * 2.测试数据库连接
 *
 * @author wangjie
 * @version V1.0
 * @date 2020/1/20
 */
//@Mapper
public interface  UserDao {

    @Insert(value="insert into t_user(name, nick) values (#{name}, #{nick})")
    int add(User person);

    @Delete(value="delete from t_user where id=#{id}")
    int delete(long id);

    @Update(value="update t_user set name=#{name}, nick=#{nick} where id=#{id}")
    void update(User person);

    @Select(value="select * from t_user where id=#{id}")
    User select(long id);
}
